<!--
 * @Author: your name
 * @Date: 2021-01-04 14:30:09
 * @LastEditTime: 2021-01-04 14:54:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basiccss\fudong\clearFD1.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动1</title>
    <style>
        .clearfix{
            clear: both;
            height: 0;
        }
        article{
            border: 2px solid #dddddd;
        }
        div{
            width: 200px;
            height: 200px;
            margin-bottom: 10px;
        }
        div.green{
            border: solid 2px green;
            float: left;
        }
        div.red{
            border: solid 2px red;
            float: left;
        }
        div.blue{
            background: blue;
        }
    </style>
</head>
<body>
    <article>
        <div class="green"></div>
        <div class="red"></div>
        <p class="clearfix"></p>
    </article>
</body>
</html>